﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Marin.Entities;

namespace Marin.Repository.Mapping
{
    public class DetalleNewEgresoMap:EntityTypeConfiguration<DetalleNewEgreso>
    {
        public DetalleNewEgresoMap()
        {
            // Primary Key
            this.HasKey(t => new { t.Descripcion, t.IdEgreso });

            


            this.Property(t => t.Motivo)
                .HasMaxLength(200);


          
            // Table & Column Mappings
            this.ToTable("DetalleNewEgreso");
            
            

            // Relationships



            this.HasRequired(t => t.Egreso)
                .WithMany(t => t.DetalleNewEgresoes)
                .HasForeignKey(d => d.IdEgreso)
                .WillCascadeOnDelete(false);
        }
    }
}
